From: Florian Müllner Date: Fri, 12 Jul 2019 03:25:54 +0000 (+0200) Subject: calendar: Avoid a warning X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~845^2^2~37 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=c765082f72d69ea2880f93cdb26466e310552cb4;p=gnome-shell.git calendar: Avoid a warning We will always get a results array from gjs' proxy wrapper, but it will be empty in the error case; that is, `results` is always defined, but `results[0]` may not be. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/626 --- diff --git a/js/ui/calendar.js b/js/ui/calendar.js index 3371004fc..01a56baee 100644 --- a/js/ui/calendar.js +++ b/js/ui/calendar.js @@ -237,7 +237,7 @@ var DBusEventSource = class DBusEventSource { _onEventsReceived(results, error) { let newEvents = []; - let appointments = results ? results[0] : null; + let appointments = results[0] || null; if (appointments != null) { for (let n = 0; n < appointments.length; n++) { let a = appointments[n];